package com.itedge.infrastructure.taskdata.impl;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.MappedSuperclass;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import com.itedge.infrastructure.taskdata.ITaskDataEntity;

/**
 * Default implementation of {@link ITaskDataEntity} interface, with definition of common properties 
 * shared by all task data Entities.
 * 
 * @author jhe
 *
 */
@MappedSuperclass
public abstract class AbstractTaskDataEntity implements ITaskDataEntity {

	/**
	 * Id of linked task object.
	 */
    @Column(name="TASK_ID")
    private String taskId; 
    
    /**
     * Store informations about last user, who modified and persisted task data entity.
     */
    @Column(name="LAST_UPDATED_BY")
    private String lastUpdatedBy;
    
    /**
     * Store informations about current user holding lock on task data instance.
     */
    @Column(name="LOCKED_BY")
    private String lockedBy;
    
    /**
     * Last date, when task data entity was persisted
     */
    @Column(name="LAST_UPDATED_DATE")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedDate;
	
    @Override
	public abstract void setVersion(Integer version);
	
    @Override
	public abstract void setId(Long id);
    
    @Override
	public String getTaskId() {
		return this.taskId;
	}
	
    @Override
	public void setTaskId(String id) {
		this.taskId = id;
	}
	
    @Override
	public String getLastUpdatedBy() {
		return lastUpdatedBy;
	}

    @Override
	public void setLastUpdatedBy(String lastUpdatedBy) {
		this.lastUpdatedBy = lastUpdatedBy;
	}

    @Override
	public Date getLastUpdatedDate() {
		return lastUpdatedDate;
	}

    @Override
	public void setLastUpdatedDate(Date lastUpdatedDate) {
		this.lastUpdatedDate = lastUpdatedDate;
	}

    @Override
	public String getLockedBy() {
		return lockedBy;
	}

    @Override
	public void setLockedBy(String lockedBy) {
		this.lockedBy = lockedBy;
	}
    
}
